public class test7 {
    public static void move(char pos1,char pos2) {
        System.out.println(pos1+"->"+pos2+" ");

    }
    public static void hanoi(int m,char pos1,char pos2,char pos3) {
        if (m == 1) {
            move(pos1, pos2);
            return;
        }
        hanoi(m - 1, pos1, pos3, pos2);
        move(pos1, pos3);
        hanoi(m - 1, pos2, pos1, pos3);

    }

    public static void main(String[] args) {
        int m=3;
        char a ='A',b='b',c='C';
        hanoi(m,a,b,c);
    }
}
